package org.jeecg.modules.paycenter.channel.bankdocking.dto;

import cn.hutool.core.date.DateUtil;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.modules.wlhy.utils.CodeUtil;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.math.BigDecimal;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "ap")
public class ReqPacket {
    @XmlElement
    private String CCTransCode;
    @XmlElement
    private String CorpNo;
    @XmlElement
    private String OpNo;

    @XmlElement
    private String AuthNo;
    @XmlElement
    private String ChannelType;
    @XmlElement
    private String ProductID;

    @XmlElement
    private String ReqDate;
    @XmlElement
    private String ReqTime;
    @XmlElement
    private String Sign;

    @XmlElement
    private String ReqSeqNo;


    @XmlElement(name = "Amt")
    private BigDecimal amt;

    @XmlElement
    private Cmp Cmp;

    @XmlElement
    private Acc Acc;

    @XmlElement
    private Corp Corp;

    @XmlElement
    private Cme Cme;

    @XmlElement
    private Channel Channel;

    @XmlElement
    private Pds Pds;
    public ReqPacket() {
        this.ProductID = "ICC";
        this.ChannelType = "ERP";
        this.OpNo = "";
        this.Sign = "";
        this.AuthNo = "";

        Date date = new Date();
        String reqDate = DateUtil.format(date, "yyyyMMdd");
        String reqTime = DateUtil.format(date, "HHmmss");
        this.ReqSeqNo = CodeUtil.getBillNum();
        this.ReqDate = reqDate;
        this.ReqTime = reqTime;
    }

}
